<template>
  <div class="list-item">
    <div class="list-item-content">
      <div>
        <slot name="icon"></slot>
        <span>{{leftText}}</span>
      </div>
      <div>
        <span>{{rightText}}</span>
        <span class="right-arrow" v-if="hasRightArrow"></span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    leftText: { // 左边文字
      type: String,
      default: ''
    },
    rightText: { // 右边文字
      type: String,
      default: ''
    },
    hasRightArrow: { // 是否显示向右箭头
      type: Boolean,
      default: true
    }
  }
}
</script>

<style scoped lang="scss">
.list-item {
  box-sizing: border-box;
  width: 100%;
  height: 0.9rem;
  line-height: 0.9rem;
  padding-left: 0.3rem;
  background-color: #fff;
  .list-item-content {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    padding-right: 0.3rem;
    border-bottom: 1px solid #f6f6f6;
    img {
      display: inline-block;
      width: 0.4rem;
      height: auto;
      vertical-align: middle;
      margin-right: 0.15rem;
    }
    span {
      vertical-align: middle;
      font-size: 0.3rem;
      color: rgba(102, 102, 102, 1);
      font-weight: 700;
    }
  }
  .right-arrow {
    display: inline-block;
    width: 0.18rem;
    height: 0.18rem;
    border-top: 1px solid #999;
    border-right: 1px solid #999;
    transform: rotate(45deg);
    margin-right: 0.3rem;
  }
}
</style>
